package com.itmuch.cloud.controller;

import com.itmuch.cloud.dao.UserRepository;
import com.itmuch.cloud.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Aaron
 * @since 2020/12/23 13:15
 * <p>描述：</p>
 */
@RestController
public class UserController {
    private final UserRepository userRepository;

    public UserController(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @GetMapping("/{id}")
    public User findById(@PathVariable Long id) {
        return this.userRepository.getOne(id);
    }

}
